import request from '@/plugins/axios'

export function login(username, password, code, uuid) {
    return request({
        url: '/auth/login',
        method: 'post',
        data: {
            username,
            password,
            code,
            uuid
        }
    })
}
export function Phonelogin(telnumber, password, code, uuid) {
    return request({
        url: '/auth/Phonelogin',
        method: 'post',
        data: {
            telnumber,
            password,
            code,
            uuid
        }
    })
}

export function getInfo() {
    return request({
        url: '/auth/info',
        method: 'get'
    })
}

export function getMenu() {
    return request({
        url: '/admin/menu',
        method: 'get'
    })
}
export function UnLock (id) {
    return request({
        url: '/auth/UnLock/'+id,
        method: 'put',
    })
}
export function getCodeImg() {
    return request({
        url: '/auth/code',
        method: 'get'
    })
}export function getPhoneCodeImg(telnumber) {
    return request({
        url: '/auth/PhoneCode/'+telnumber,
        method: 'get'
    })
}

export function logout() {
    return request({
        url: '/auth/logout',
        method: 'delete'
    })
}

export function passwordIsRight(username, password) {
    return request({
        url: '/auth/passwordIsRight',
        method: 'post',
        data: {
            username,
            password,
        }
    })
}
